class test(object):
    def __init__(self, switch):
        self.switch = switch

    def calc(self, a, b):
        try:
            a / b
        except Exception as result:
            if self.switch == True:
                print("捕获开启，捕获信息如下：\n", result)
            else:
                raise


a = test(True)
a.calc(11, 0)

print("-------分隔符-------")

b = test(False)
b.calc(11, 0)
